﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on: 
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using VNet.VisiSuite.Dal.EntityClasses;
using VNet.VisiSuite.Dal.HelperClasses;
using VNet.VisiSuite.Dal.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace VNet.VisiSuite.Dal.FactoryClasses
{
	
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END
	
	/// <summary>general base class for the generated factories</summary>
	[Serializable]
	public partial class EntityFactoryBase2<TEntity> : EntityFactoryCore2
		where TEntity : EntityBase2, IEntity2
	{
		private readonly VNet.VisiSuite.Dal.EntityType _typeOfEntity;
		private readonly bool _isInHierarchy;
		
		/// <summary>CTor</summary>
		/// <param name="entityName">Name of the entity.</param>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <param name="isInHierarchy">If true, the entity of this factory is in an inheritance hierarchy, false otherwise</param>
		public EntityFactoryBase2(string entityName, VNet.VisiSuite.Dal.EntityType typeOfEntity, bool isInHierarchy) : base(entityName)
		{
			_typeOfEntity = typeOfEntity;
			_isInHierarchy = isInHierarchy;
		}
		
		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields2 object for the entity to create.</summary>
		/// <returns>Empty IEntityFields2 object.</returns>
		public override IEntityFields2 CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(_typeOfEntity);
		}
		
		/// <summary>Creates a new entity instance using the GeneralEntityFactory in the generated code, using the passed in entitytype value</summary>
		/// <param name="entityTypeValue">The entity type value of the entity to create an instance for.</param>
		/// <returns>new IEntity instance</returns>
		public override IEntity2 CreateEntityFromEntityTypeValue(int entityTypeValue)
		{
			return GeneralEntityFactory.Create((VNet.VisiSuite.Dal.EntityType)entityTypeValue);
		}

		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <param name="objectAlias">The object alias to use for the elements in the relations.</param>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public override IRelationCollection CreateHierarchyRelations(string objectAlias) 
		{
			return InheritanceInfoProviderSingleton.GetInstance().GetHierarchyRelations(this.ForEntityName, objectAlias);
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public override IEntityFactory2 GetEntityFactory(object[] fieldValues, Dictionary<string, int> entityFieldStartIndexesPerEntity) 
		{
			IEntityFactory2 toReturn = (IEntityFactory2)InheritanceInfoProviderSingleton.GetInstance().GetEntityFactory(this.ForEntityName, fieldValues, entityFieldStartIndexesPerEntity);
			if(toReturn == null)
			{
				toReturn = this;
			}
			return toReturn;
		}
		
		/// <summary>Gets a predicateexpression which filters on the entity with type belonging to this factory.</summary>
		/// <param name="negate">Flag to produce a NOT filter, (true), or a normal filter (false). </param>
		/// <param name="objectAlias">The object alias to use for the predicate(s).</param>
		/// <returns>ready to use predicateexpression, or an empty predicate expression if the belonging entity isn't a hierarchical type.</returns>
		public override IPredicateExpression GetEntityTypeFilter(bool negate, string objectAlias) 
		{
			return InheritanceInfoProviderSingleton.GetInstance().GetEntityTypeFilter(this.ForEntityName, objectAlias, negate);
		}
						
		/// <summary>Creates a new generic EntityCollection(Of T) for the entity which this factory belongs to.</summary>
		/// <returns>ready to use generic EntityCollection(Of T) with this factory set as the factory</returns>
		public override IEntityCollection2 CreateEntityCollection()
		{
			return new EntityCollection<TEntity>(this);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields2 object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public override IEntityFields2 CreateHierarchyFields() 
		{
			return _isInHierarchy ? new EntityFields2(InheritanceInfoProviderSingleton.GetInstance().GetHierarchyFields(this.ForEntityName), InheritanceInfoProviderSingleton.GetInstance(), null) : base.CreateHierarchyFields();
		}
	}

	/// <summary>Factory to create new, empty AlarmSettingEntity objects.</summary>
	[Serializable]
	public partial class AlarmSettingEntityFactory : EntityFactoryBase2<AlarmSettingEntity> {
		/// <summary>CTor</summary>
		public AlarmSettingEntityFactory() : base("AlarmSettingEntity", VNet.VisiSuite.Dal.EntityType.AlarmSettingEntity, false) { }
		
		/// <summary>Creates a new AlarmSettingEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new AlarmSettingEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAlarmSettingUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty AreaEntity objects.</summary>
	[Serializable]
	public partial class AreaEntityFactory : EntityFactoryBase2<AreaEntity> {
		/// <summary>CTor</summary>
		public AreaEntityFactory() : base("AreaEntity", VNet.VisiSuite.Dal.EntityType.AreaEntity, false) { }
		
		/// <summary>Creates a new AreaEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new AreaEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAreaUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty AreaShiftEntity objects.</summary>
	[Serializable]
	public partial class AreaShiftEntityFactory : EntityFactoryBase2<AreaShiftEntity> {
		/// <summary>CTor</summary>
		public AreaShiftEntityFactory() : base("AreaShiftEntity", VNet.VisiSuite.Dal.EntityType.AreaShiftEntity, false) { }
		
		/// <summary>Creates a new AreaShiftEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new AreaShiftEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAreaShiftUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty BraiderProductEntity objects.</summary>
	[Serializable]
	public partial class BraiderProductEntityFactory : EntityFactoryBase2<BraiderProductEntity> {
		/// <summary>CTor</summary>
		public BraiderProductEntityFactory() : base("BraiderProductEntity", VNet.VisiSuite.Dal.EntityType.BraiderProductEntity, false) { }
		
		/// <summary>Creates a new BraiderProductEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new BraiderProductEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewBraiderProductUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty CellEntity objects.</summary>
	[Serializable]
	public partial class CellEntityFactory : EntityFactoryBase2<CellEntity> {
		/// <summary>CTor</summary>
		public CellEntityFactory() : base("CellEntity", VNet.VisiSuite.Dal.EntityType.CellEntity, false) { }
		
		/// <summary>Creates a new CellEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new CellEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCellUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty CellAlarmSettingEntity objects.</summary>
	[Serializable]
	public partial class CellAlarmSettingEntityFactory : EntityFactoryBase2<CellAlarmSettingEntity> {
		/// <summary>CTor</summary>
		public CellAlarmSettingEntityFactory() : base("CellAlarmSettingEntity", VNet.VisiSuite.Dal.EntityType.CellAlarmSettingEntity, false) { }
		
		/// <summary>Creates a new CellAlarmSettingEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new CellAlarmSettingEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCellAlarmSettingUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty CellShiftEntity objects.</summary>
	[Serializable]
	public partial class CellShiftEntityFactory : EntityFactoryBase2<CellShiftEntity> {
		/// <summary>CTor</summary>
		public CellShiftEntityFactory() : base("CellShiftEntity", VNet.VisiSuite.Dal.EntityType.CellShiftEntity, false) { }
		
		/// <summary>Creates a new CellShiftEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new CellShiftEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCellShiftUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty CellStatusEntity objects.</summary>
	[Serializable]
	public partial class CellStatusEntityFactory : EntityFactoryBase2<CellStatusEntity> {
		/// <summary>CTor</summary>
		public CellStatusEntityFactory() : base("CellStatusEntity", VNet.VisiSuite.Dal.EntityType.CellStatusEntity, false) { }
		
		/// <summary>Creates a new CellStatusEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new CellStatusEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCellStatusUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty DatabaseVersionEntity objects.</summary>
	[Serializable]
	public partial class DatabaseVersionEntityFactory : EntityFactoryBase2<DatabaseVersionEntity> {
		/// <summary>CTor</summary>
		public DatabaseVersionEntityFactory() : base("DatabaseVersionEntity", VNet.VisiSuite.Dal.EntityType.DatabaseVersionEntity, false) { }
		
		/// <summary>Creates a new DatabaseVersionEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new DatabaseVersionEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDatabaseVersionUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty DowntimeButtonEntity objects.</summary>
	[Serializable]
	public partial class DowntimeButtonEntityFactory : EntityFactoryBase2<DowntimeButtonEntity> {
		/// <summary>CTor</summary>
		public DowntimeButtonEntityFactory() : base("DowntimeButtonEntity", VNet.VisiSuite.Dal.EntityType.DowntimeButtonEntity, false) { }
		
		/// <summary>Creates a new DowntimeButtonEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new DowntimeButtonEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDowntimeButtonUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty DrouteEntity objects.</summary>
	[Serializable]
	public partial class DrouteEntityFactory : EntityFactoryBase2<DrouteEntity> {
		/// <summary>CTor</summary>
		public DrouteEntityFactory() : base("DrouteEntity", VNet.VisiSuite.Dal.EntityType.DrouteEntity, false) { }
		
		/// <summary>Creates a new DrouteEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new DrouteEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDrouteUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty EmployeeEntity objects.</summary>
	[Serializable]
	public partial class EmployeeEntityFactory : EntityFactoryBase2<EmployeeEntity> {
		/// <summary>CTor</summary>
		public EmployeeEntityFactory() : base("EmployeeEntity", VNet.VisiSuite.Dal.EntityType.EmployeeEntity, false) { }
		
		/// <summary>Creates a new EmployeeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new EmployeeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewEmployeeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty EmpOperEntity objects.</summary>
	[Serializable]
	public partial class EmpOperEntityFactory : EntityFactoryBase2<EmpOperEntity> {
		/// <summary>CTor</summary>
		public EmpOperEntityFactory() : base("EmpOperEntity", VNet.VisiSuite.Dal.EntityType.EmpOperEntity, false) { }
		
		/// <summary>Creates a new EmpOperEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new EmpOperEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewEmpOperUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty EmpTimeEntity objects.</summary>
	[Serializable]
	public partial class EmpTimeEntityFactory : EntityFactoryBase2<EmpTimeEntity> {
		/// <summary>CTor</summary>
		public EmpTimeEntityFactory() : base("EmpTimeEntity", VNet.VisiSuite.Dal.EntityType.EmpTimeEntity, false) { }
		
		/// <summary>Creates a new EmpTimeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new EmpTimeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewEmpTimeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty FileTimeEntity objects.</summary>
	[Serializable]
	public partial class FileTimeEntityFactory : EntityFactoryBase2<FileTimeEntity> {
		/// <summary>CTor</summary>
		public FileTimeEntityFactory() : base("FileTimeEntity", VNet.VisiSuite.Dal.EntityType.FileTimeEntity, false) { }
		
		/// <summary>Creates a new FileTimeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new FileTimeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFileTimeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty FractionalInchEntity objects.</summary>
	[Serializable]
	public partial class FractionalInchEntityFactory : EntityFactoryBase2<FractionalInchEntity> {
		/// <summary>CTor</summary>
		public FractionalInchEntityFactory() : base("FractionalInchEntity", VNet.VisiSuite.Dal.EntityType.FractionalInchEntity, false) { }
		
		/// <summary>Creates a new FractionalInchEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new FractionalInchEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFractionalInchUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty HoseSpecEntity objects.</summary>
	[Serializable]
	public partial class HoseSpecEntityFactory : EntityFactoryBase2<HoseSpecEntity> {
		/// <summary>CTor</summary>
		public HoseSpecEntityFactory() : base("HoseSpecEntity", VNet.VisiSuite.Dal.EntityType.HoseSpecEntity, false) { }
		
		/// <summary>Creates a new HoseSpecEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new HoseSpecEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHoseSpecUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty LaunchApplicationEntity objects.</summary>
	[Serializable]
	public partial class LaunchApplicationEntityFactory : EntityFactoryBase2<LaunchApplicationEntity> {
		/// <summary>CTor</summary>
		public LaunchApplicationEntityFactory() : base("LaunchApplicationEntity", VNet.VisiSuite.Dal.EntityType.LaunchApplicationEntity, false) { }
		
		/// <summary>Creates a new LaunchApplicationEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new LaunchApplicationEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLaunchApplicationUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty OperationEntity objects.</summary>
	[Serializable]
	public partial class OperationEntityFactory : EntityFactoryBase2<OperationEntity> {
		/// <summary>CTor</summary>
		public OperationEntityFactory() : base("OperationEntity", VNet.VisiSuite.Dal.EntityType.OperationEntity, false) { }
		
		/// <summary>Creates a new OperationEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new OperationEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewOperationUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty OperatorEntity objects.</summary>
	[Serializable]
	public partial class OperatorEntityFactory : EntityFactoryBase2<OperatorEntity> {
		/// <summary>CTor</summary>
		public OperatorEntityFactory() : base("OperatorEntity", VNet.VisiSuite.Dal.EntityType.OperatorEntity, false) { }
		
		/// <summary>Creates a new OperatorEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new OperatorEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewOperatorUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty OperatorAuthEntity objects.</summary>
	[Serializable]
	public partial class OperatorAuthEntityFactory : EntityFactoryBase2<OperatorAuthEntity> {
		/// <summary>CTor</summary>
		public OperatorAuthEntityFactory() : base("OperatorAuthEntity", VNet.VisiSuite.Dal.EntityType.OperatorAuthEntity, false) { }
		
		/// <summary>Creates a new OperatorAuthEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new OperatorAuthEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewOperatorAuthUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty OschdEntity objects.</summary>
	[Serializable]
	public partial class OschdEntityFactory : EntityFactoryBase2<OschdEntity> {
		/// <summary>CTor</summary>
		public OschdEntityFactory() : base("OschdEntity", VNet.VisiSuite.Dal.EntityType.OschdEntity, false) { }
		
		/// <summary>Creates a new OschdEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new OschdEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewOschdUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty PlantEntity objects.</summary>
	[Serializable]
	public partial class PlantEntityFactory : EntityFactoryBase2<PlantEntity> {
		/// <summary>CTor</summary>
		public PlantEntityFactory() : base("PlantEntity", VNet.VisiSuite.Dal.EntityType.PlantEntity, false) { }
		
		/// <summary>Creates a new PlantEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new PlantEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewPlantUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductEntity objects.</summary>
	[Serializable]
	public partial class ProductEntityFactory : EntityFactoryBase2<ProductEntity> {
		/// <summary>CTor</summary>
		public ProductEntityFactory() : base("ProductEntity", VNet.VisiSuite.Dal.EntityType.ProductEntity, false) { }
		
		/// <summary>Creates a new ProductEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductionHistoryEntity objects.</summary>
	[Serializable]
	public partial class ProductionHistoryEntityFactory : EntityFactoryBase2<ProductionHistoryEntity> {
		/// <summary>CTor</summary>
		public ProductionHistoryEntityFactory() : base("ProductionHistoryEntity", VNet.VisiSuite.Dal.EntityType.ProductionHistoryEntity, false) { }
		
		/// <summary>Creates a new ProductionHistoryEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductionHistoryEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductionHistoryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductionHistoryDowntimeEventEntity objects.</summary>
	[Serializable]
	public partial class ProductionHistoryDowntimeEventEntityFactory : EntityFactoryBase2<ProductionHistoryDowntimeEventEntity> {
		/// <summary>CTor</summary>
		public ProductionHistoryDowntimeEventEntityFactory() : base("ProductionHistoryDowntimeEventEntity", VNet.VisiSuite.Dal.EntityType.ProductionHistoryDowntimeEventEntity, false) { }
		
		/// <summary>Creates a new ProductionHistoryDowntimeEventEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductionHistoryDowntimeEventEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductionHistoryDowntimeEventUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductionPlanEntity objects.</summary>
	[Serializable]
	public partial class ProductionPlanEntityFactory : EntityFactoryBase2<ProductionPlanEntity> {
		/// <summary>CTor</summary>
		public ProductionPlanEntityFactory() : base("ProductionPlanEntity", VNet.VisiSuite.Dal.EntityType.ProductionPlanEntity, false) { }
		
		/// <summary>Creates a new ProductionPlanEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductionPlanEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductionPlanUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductionPlanScheduledDowntimeEntity objects.</summary>
	[Serializable]
	public partial class ProductionPlanScheduledDowntimeEntityFactory : EntityFactoryBase2<ProductionPlanScheduledDowntimeEntity> {
		/// <summary>CTor</summary>
		public ProductionPlanScheduledDowntimeEntityFactory() : base("ProductionPlanScheduledDowntimeEntity", VNet.VisiSuite.Dal.EntityType.ProductionPlanScheduledDowntimeEntity, false) { }
		
		/// <summary>Creates a new ProductionPlanScheduledDowntimeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductionPlanScheduledDowntimeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductionPlanScheduledDowntimeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ProductOperationTimeEntity objects.</summary>
	[Serializable]
	public partial class ProductOperationTimeEntityFactory : EntityFactoryBase2<ProductOperationTimeEntity> {
		/// <summary>CTor</summary>
		public ProductOperationTimeEntityFactory() : base("ProductOperationTimeEntity", VNet.VisiSuite.Dal.EntityType.ProductOperationTimeEntity, false) { }
		
		/// <summary>Creates a new ProductOperationTimeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ProductOperationTimeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductOperationTimeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ReasonCodeEntity objects.</summary>
	[Serializable]
	public partial class ReasonCodeEntityFactory : EntityFactoryBase2<ReasonCodeEntity> {
		/// <summary>CTor</summary>
		public ReasonCodeEntityFactory() : base("ReasonCodeEntity", VNet.VisiSuite.Dal.EntityType.ReasonCodeEntity, false) { }
		
		/// <summary>Creates a new ReasonCodeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ReasonCodeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewReasonCodeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty RollupDefinitionEntity objects.</summary>
	[Serializable]
	public partial class RollupDefinitionEntityFactory : EntityFactoryBase2<RollupDefinitionEntity> {
		/// <summary>CTor</summary>
		public RollupDefinitionEntityFactory() : base("RollupDefinitionEntity", VNet.VisiSuite.Dal.EntityType.RollupDefinitionEntity, false) { }
		
		/// <summary>Creates a new RollupDefinitionEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new RollupDefinitionEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRollupDefinitionUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty SchdOperEntity objects.</summary>
	[Serializable]
	public partial class SchdOperEntityFactory : EntityFactoryBase2<SchdOperEntity> {
		/// <summary>CTor</summary>
		public SchdOperEntityFactory() : base("SchdOperEntity", VNet.VisiSuite.Dal.EntityType.SchdOperEntity, false) { }
		
		/// <summary>Creates a new SchdOperEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new SchdOperEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSchdOperUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty SchdShipEntity objects.</summary>
	[Serializable]
	public partial class SchdShipEntityFactory : EntityFactoryBase2<SchdShipEntity> {
		/// <summary>CTor</summary>
		public SchdShipEntityFactory() : base("SchdShipEntity", VNet.VisiSuite.Dal.EntityType.SchdShipEntity, false) { }
		
		/// <summary>Creates a new SchdShipEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new SchdShipEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSchdShipUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ScheduleEntity objects.</summary>
	[Serializable]
	public partial class ScheduleEntityFactory : EntityFactoryBase2<ScheduleEntity> {
		/// <summary>CTor</summary>
		public ScheduleEntityFactory() : base("ScheduleEntity", VNet.VisiSuite.Dal.EntityType.ScheduleEntity, false) { }
		
		/// <summary>Creates a new ScheduleEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ScheduleEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewScheduleUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty ScheduleRepeatEntity objects.</summary>
	[Serializable]
	public partial class ScheduleRepeatEntityFactory : EntityFactoryBase2<ScheduleRepeatEntity> {
		/// <summary>CTor</summary>
		public ScheduleRepeatEntityFactory() : base("ScheduleRepeatEntity", VNet.VisiSuite.Dal.EntityType.ScheduleRepeatEntity, false) { }
		
		/// <summary>Creates a new ScheduleRepeatEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new ScheduleRepeatEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewScheduleRepeatUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty SrouteEntity objects.</summary>
	[Serializable]
	public partial class SrouteEntityFactory : EntityFactoryBase2<SrouteEntity> {
		/// <summary>CTor</summary>
		public SrouteEntityFactory() : base("SrouteEntity", VNet.VisiSuite.Dal.EntityType.SrouteEntity, false) { }
		
		/// <summary>Creates a new SrouteEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new SrouteEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSrouteUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty StationEntity objects.</summary>
	[Serializable]
	public partial class StationEntityFactory : EntityFactoryBase2<StationEntity> {
		/// <summary>CTor</summary>
		public StationEntityFactory() : base("StationEntity", VNet.VisiSuite.Dal.EntityType.StationEntity, false) { }
		
		/// <summary>Creates a new StationEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new StationEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewStationUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty SyncLogEntity objects.</summary>
	[Serializable]
	public partial class SyncLogEntityFactory : EntityFactoryBase2<SyncLogEntity> {
		/// <summary>CTor</summary>
		public SyncLogEntityFactory() : base("SyncLogEntity", VNet.VisiSuite.Dal.EntityType.SyncLogEntity, false) { }
		
		/// <summary>Creates a new SyncLogEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new SyncLogEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSyncLogUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty TableDataChangeEntity objects.</summary>
	[Serializable]
	public partial class TableDataChangeEntityFactory : EntityFactoryBase2<TableDataChangeEntity> {
		/// <summary>CTor</summary>
		public TableDataChangeEntityFactory() : base("TableDataChangeEntity", VNet.VisiSuite.Dal.EntityType.TableDataChangeEntity, false) { }
		
		/// <summary>Creates a new TableDataChangeEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new TableDataChangeEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTableDataChangeUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty UserLoginEntity objects.</summary>
	[Serializable]
	public partial class UserLoginEntityFactory : EntityFactoryBase2<UserLoginEntity> {
		/// <summary>CTor</summary>
		public UserLoginEntityFactory() : base("UserLoginEntity", VNet.VisiSuite.Dal.EntityType.UserLoginEntity, false) { }
		
		/// <summary>Creates a new UserLoginEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new UserLoginEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserLoginUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty UserLoginHistoryEntity objects.</summary>
	[Serializable]
	public partial class UserLoginHistoryEntityFactory : EntityFactoryBase2<UserLoginHistoryEntity> {
		/// <summary>CTor</summary>
		public UserLoginHistoryEntityFactory() : base("UserLoginHistoryEntity", VNet.VisiSuite.Dal.EntityType.UserLoginHistoryEntity, false) { }
		
		/// <summary>Creates a new UserLoginHistoryEntity instance but uses a special constructor which will set the Fields object of the new IEntity2 instance to the passed in fields object.</summary>
		/// <param name="fields">Populated IEntityFields2 object for the new IEntity2 to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields2 object) IEntity2 object</returns>
		public override IEntity2 Create(IEntityFields2 fields) {
			IEntity2 toReturn = new UserLoginHistoryEntity(fields);
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserLoginHistoryUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}
		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new, empty Entity objects based on the entity type specified. Uses  entity specific factory objects</summary>
	[Serializable]
	public partial class GeneralEntityFactory
	{
		/// <summary>Creates a new, empty Entity object of the type specified</summary>
		/// <param name="entityTypeToCreate">The entity type to create.</param>
		/// <returns>A new, empty Entity object.</returns>
		public static IEntity2 Create(VNet.VisiSuite.Dal.EntityType entityTypeToCreate)
		{
			IEntityFactory2 factoryToUse = null;
			switch(entityTypeToCreate)
			{
				case VNet.VisiSuite.Dal.EntityType.AlarmSettingEntity:
					factoryToUse = new AlarmSettingEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.AreaEntity:
					factoryToUse = new AreaEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.AreaShiftEntity:
					factoryToUse = new AreaShiftEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.BraiderProductEntity:
					factoryToUse = new BraiderProductEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.CellEntity:
					factoryToUse = new CellEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.CellAlarmSettingEntity:
					factoryToUse = new CellAlarmSettingEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.CellShiftEntity:
					factoryToUse = new CellShiftEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.CellStatusEntity:
					factoryToUse = new CellStatusEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.DatabaseVersionEntity:
					factoryToUse = new DatabaseVersionEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.DowntimeButtonEntity:
					factoryToUse = new DowntimeButtonEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.DrouteEntity:
					factoryToUse = new DrouteEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.EmployeeEntity:
					factoryToUse = new EmployeeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.EmpOperEntity:
					factoryToUse = new EmpOperEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.EmpTimeEntity:
					factoryToUse = new EmpTimeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.FileTimeEntity:
					factoryToUse = new FileTimeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.FractionalInchEntity:
					factoryToUse = new FractionalInchEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.HoseSpecEntity:
					factoryToUse = new HoseSpecEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.LaunchApplicationEntity:
					factoryToUse = new LaunchApplicationEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.OperationEntity:
					factoryToUse = new OperationEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.OperatorEntity:
					factoryToUse = new OperatorEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.OperatorAuthEntity:
					factoryToUse = new OperatorAuthEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.OschdEntity:
					factoryToUse = new OschdEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.PlantEntity:
					factoryToUse = new PlantEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductEntity:
					factoryToUse = new ProductEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductionHistoryEntity:
					factoryToUse = new ProductionHistoryEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductionHistoryDowntimeEventEntity:
					factoryToUse = new ProductionHistoryDowntimeEventEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductionPlanEntity:
					factoryToUse = new ProductionPlanEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductionPlanScheduledDowntimeEntity:
					factoryToUse = new ProductionPlanScheduledDowntimeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ProductOperationTimeEntity:
					factoryToUse = new ProductOperationTimeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ReasonCodeEntity:
					factoryToUse = new ReasonCodeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.RollupDefinitionEntity:
					factoryToUse = new RollupDefinitionEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.SchdOperEntity:
					factoryToUse = new SchdOperEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.SchdShipEntity:
					factoryToUse = new SchdShipEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ScheduleEntity:
					factoryToUse = new ScheduleEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.ScheduleRepeatEntity:
					factoryToUse = new ScheduleRepeatEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.SrouteEntity:
					factoryToUse = new SrouteEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.StationEntity:
					factoryToUse = new StationEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.SyncLogEntity:
					factoryToUse = new SyncLogEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.TableDataChangeEntity:
					factoryToUse = new TableDataChangeEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.UserLoginEntity:
					factoryToUse = new UserLoginEntityFactory();
					break;
				case VNet.VisiSuite.Dal.EntityType.UserLoginHistoryEntity:
					factoryToUse = new UserLoginHistoryEntityFactory();
					break;
			}
			IEntity2 toReturn = null;
			if(factoryToUse != null)
			{
				toReturn = factoryToUse.Create();
			}
			return toReturn;
		}		
	}
		
	/// <summary>Class which is used to obtain the entity factory based on the .NET type of the entity. </summary>
	[Serializable]
	public static class EntityFactoryFactory
	{
		private static Dictionary<Type, IEntityFactory2> _factoryPerType = new Dictionary<Type, IEntityFactory2>();

		/// <summary>Initializes the <see cref="EntityFactoryFactory"/> class.</summary>
		static EntityFactoryFactory()
		{
			Array entityTypeValues = Enum.GetValues(typeof(VNet.VisiSuite.Dal.EntityType));
			foreach(int entityTypeValue in entityTypeValues)
			{
				IEntity2 dummy = GeneralEntityFactory.Create((VNet.VisiSuite.Dal.EntityType)entityTypeValue);
				_factoryPerType.Add(dummy.GetType(), dummy.GetEntityFactory());
			}
		}

		/// <summary>Gets the factory of the entity with the .NET type specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory2 GetFactory(Type typeOfEntity)
		{
			IEntityFactory2 toReturn = null;
			_factoryPerType.TryGetValue(typeOfEntity, out toReturn);
			return toReturn;
		}

		/// <summary>Gets the factory of the entity with the VNet.VisiSuite.Dal.EntityType specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory2 GetFactory(VNet.VisiSuite.Dal.EntityType typeOfEntity)
		{
			return GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType());
		}
	}
		
	/// <summary>Element creator for creating project elements from somewhere else, like inside Linq providers.</summary>
	public class ElementCreator : ElementCreatorBase, IElementCreator2
	{
		/// <summary>Gets the factory of the Entity type with the VNet.VisiSuite.Dal.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory2 GetFactory(int entityTypeValue)
		{
			return (IEntityFactory2)this.GetFactoryImpl(entityTypeValue);
		}
		
		/// <summary>Gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory2 GetFactory(Type typeOfEntity)
		{
			return (IEntityFactory2)this.GetFactoryImpl(typeOfEntity);
		}

		/// <summary>Creates a new resultset fields object with the number of field slots reserved as specified</summary>
		/// <param name="numberOfFields">The number of fields.</param>
		/// <returns>ready to use resultsetfields object</returns>
		public IEntityFields2 CreateResultsetFields(int numberOfFields)
		{
			return new ResultsetFields(numberOfFields);
		}
		
		/// <summary>Obtains the inheritance info provider instance from the singleton </summary>
		/// <returns>The singleton instance of the inheritance info provider</returns>
		public override IInheritanceInfoProvider ObtainInheritanceInfoProviderInstance()
		{
			return InheritanceInfoProviderSingleton.GetInstance();
		}


		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand)
		{
			return new DynamicRelation(leftOperand);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperand">The right operand.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, DerivedTableDefinition rightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, rightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperand">The right operand.</param>
		/// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(IEntityFieldCore leftOperand, JoinHint joinType, DerivedTableDefinition rightOperand, string aliasLeftOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, rightOperand, aliasLeftOperand, onClause);
		}


		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, string rightOperandEntityName, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, (VNet.VisiSuite.Dal.EntityType)Enum.Parse(typeof(VNet.VisiSuite.Dal.EntityType), rightOperandEntityName, false), aliasRightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperandEntityName">Name of the entity which is used as the left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(string leftOperandEntityName, JoinHint joinType, string rightOperandEntityName, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation((VNet.VisiSuite.Dal.EntityType)Enum.Parse(typeof(VNet.VisiSuite.Dal.EntityType), leftOperandEntityName, false), joinType, (VNet.VisiSuite.Dal.EntityType)Enum.Parse(typeof(VNet.VisiSuite.Dal.EntityType), rightOperandEntityName, false), aliasLeftOperand, aliasRightOperand, onClause);
		}
		
		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(IEntityFieldCore leftOperand, JoinHint joinType, string rightOperandEntityName, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, (VNet.VisiSuite.Dal.EntityType)Enum.Parse(typeof(VNet.VisiSuite.Dal.EntityType), rightOperandEntityName, false), aliasLeftOperand, aliasRightOperand, onClause);
		}
		
		/// <summary>Implementation of the routine which gets the factory of the Entity type with the VNet.VisiSuite.Dal.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(int entityTypeValue)
		{
			return EntityFactoryFactory.GetFactory((VNet.VisiSuite.Dal.EntityType)entityTypeValue);
		}

		/// <summary>Implementation of the routine which gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(Type typeOfEntity)
		{
			return EntityFactoryFactory.GetFactory(typeOfEntity);
		}

	}
}
